#pragma once
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
#include<stdbool.h>

typedef int DataSType;

typedef struct QueueNode {
	struct Queue* next;
	DataSType data;
}QNode;

typedef struct Queue {
	QNode* head;
	QNode* tail;
	int size;
}Que;

void QueueInit(Que* pq);

void QueueDestroy(Que* pq);

void QueuePush(Que* pq, DataSType x);

void QueuePop(Que* pq);

DataSType QueueFront(Que* pq);

DataSType QueueBack(Que* pq);

bool QueueEmpty(Que* pq);

int QueueSize(Que* pq);
typedef struct Stack {
	DataSType* a;
	int top;
	int capacity;
}ST;

void STInit(ST* ps);

void STDestroy(ST* ps);

void STPush(ST* ps, DataSType x);

void STPop(ST* ps);

DataSType STTop(ST* ps);

int STSize(ST* ps);

bool STEmpty(ST* ps);

typedef struct SListNode {
	DataSType data;
	struct SListNode* next;
}SLTNode;

void SLTPrint(SLTNode* phead);

SLTNode* BuySListNode(DataSType x);

void SLTPushBack(SLTNode** pphead, DataSType x);

void SLTPushFront(SLTNode** pphead, DataSType x);

void SLTPopBack(SLTNode** pphead);

void SLTPopFront(SLTNode** pphead);

SLTNode* SLTFind(SLTNode* phead, DataSType x);

void SLTDestroy(SLTNode** pphead);

void SLTInsert(SLTNode** pphead, SLTNode* pos, DataSType x);

void SLTInsertAfter(SLTNode* pos, DataSType x);

void SLTErase(SLTNode** pphead, SLTNode* pos);

void SLTEraseAfter(SLTNode* pos);